using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NReports.SampleViewer
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
			
			rdlViewer.ShowWaitDialog = false;
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.DefaultExt = "rdl";
                ofd.Filter = "Report files (*.rdl;*rdlc)|*.rdl;*.rdlc|" +
                    "All files (*.*)|*.*";
                ofd.FilterIndex = 1;
                ofd.CheckFileExists = true;
                ofd.Multiselect = false;

                if (ofd.ShowDialog(this) == DialogResult.OK)
                {
                    string file = ofd.FileName;
                    rdlViewer.SourceFile = file;
                }
            }   
        }

        private void quitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
